<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>职工信息管理系统</title>
    <link rel="stylesheet"
	href="${pageContext.request.contextPath}/jsp/good.css">
    <link rel="stylesheet"
          href="${pageContext.request.contextPath}/jsp/a.css">
</head>
<body>
    <h1>职工信息管理系统</h1>
    <a class="gitee" target="_blank" href="https://gitee.com/joker1499/gittest">Gitee源码地址</a>

    <div class="first">
        <a href="/form.jsp">添加数据</a>
        <a href="/delete.jsp">删除数据</a>
        <a href="/update.jsp">更改数据</a>
        <a href="/query.jsp">查询数据</a>
    </div>

    <div class="second">
        <table class="table">
            <tr>
                <td class="id">编号</td>
                <td class="name">姓名</td>
                <td class="gender">性别</td>
                <td class="department">所在部门</td>
                <td class="telephone">电话</td>
                <td class="s1">应发工资</td>
                <td class="s2">扣款</td>
                <td class="s3">实发工资</td>
                <td class="delete">便捷操作</td>
            </tr>
            <c:forEach items="${roleList}" var="role">
                <tr>
                    <td class="id">${role.id}</td>
                    <td class="name">${role.rolename}</td>
                    <td class="gender">${role.gender}</td>
                    <td class="department">${role.department}</td>
                    <td class="telephone">${role.telephone}</td>
                    <td class="s1">${role.amount}</td>
                    <td class="s2">${role.deduction}</td>
                    <td class="s3">${role.salary}</td>
                    <td class="delete">
                        <a href="javascript:void(0);" onclick="Delete('${role.id}')">删除</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <a class="href" href="${pageContext.request.contextPath}/item/queryGender1?gender=${gender}" >首页</a>
        <c:if test="${requestScope.page > 1}">
            <a class="href1" href="${pageContext.request.contextPath}/item/queryGender${requestScope.page - 1}?gender=${gender}">上一页</a>
        </c:if>
        <c:if test="${!empty roleList[7] and page + 1 <= total}">
            <a class="href2" href="${pageContext.request.contextPath}/item/queryGender${requestScope.page + 1}?gender=${gender}">下一页</a>
        </c:if>
        <a class="href3" href="${pageContext.request.contextPath}/item/queryGender${total}?gender=${gender}">尾页</a>

        <a class="href4" href="${pageContext.request.contextPath}/item/page1">回到主页</a>
    </div>
</body>

<script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>

<script>
    let i = window.location.search;
    $(document).ready(function(){
        $("a[class*='href']").click(function(){
            $(this).setAttribute(gender,i);
        });
    });
</script>
</html>